<?php

class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
{

    protected function _initHelpers ()
    {
        Zend_Controller_Action_HelperBroker::addPrefix('Boladona_Helper');
    }

    protected function _initSession()
    {
        $this->bootstrap("db");

        $config = array(
          'name'           => 'sessao',
          'primary'        => 'id',
          'modifiedColumn' => 'modificado',
          'dataColumn'     => 'dados',
          'lifetimeColumn' => 'tempo_de_vida'
        );

        Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable($config));
        Zend_Session::start();
    }

    protected function _initDoctype()
    {
        $this->bootstrap('view');
        $view = $this->getResource('view');
        $view->doctype('XHTML1_STRICT');
    }

    public function _init_tradutor ()
    {
        $tradutor = new Zend_Translate(
            'array',
            APPLICATION_PATH .
            '/resources/linguas/pt_BR',
            'pt_BR',
            array('scan' => 'Zend_Validate.php')
        );
        Zend_Registry::set('Zend_Translate', $tradutor);
        Zend_Registry::set('Zend_Locale', new Zend_Locale('pt_BR'));
    }

}

